;Assembler header file for ColourTrans
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:03:52 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 28 July 1995

        [       :LNOT: :DEF: ColourTrans_Hdr
        GBLS    ColourTrans_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Get_OSSpriteOp
        GBLS    Get_OSSpriteOp
        ]
        [       :LNOT: :DEF: OSSpriteOp_Hdr
Get_OSSpriteOp                  SETS    "GET oslib/OSSpriteOp.Hdr"
        |
Get_OSSpriteOp                  SETS    ""
        ]
        $Get_OSSpriteOp

        [       :LNOT: :DEF: Get_Font
        GBLS    Get_Font
        ]
        [       :LNOT: :DEF: Font_Hdr
Get_Font                        SETS    "GET oslib/Font.Hdr"
        |
Get_Font                        SETS    ""
        ]
        $Get_Font

;Symbols for constants
ColourTrans_ColourRange         *       65536
ColourTrans_SetFG               *       &0
ColourTrans_SetBG               *       &80
ColourTrans_UseECFS             *       &100
ColourTrans_SetText             *       &200
ColourTrans_GivenSprite         *       &1
ColourTrans_CurrentIfAbsent     *       &2
ColourTrans_GivenTransferFn     *       &4
ColourTrans_ReturnGCOLList      *       &8
ColourTrans_ReturnWideEntries   *       &10
ColourTrans_ReturnPaletteTable  *       &1000000
ColourTrans_WriteDefaultCalibration *       &1
ColourTrans_PaletteForSprite    *       &1
ColourTrans_FlashingPalette     *       &2
ColourTrans_CurrentPalette      *       &FFFFFFFF
ColourTrans_DefaultPalette      *       &0
ColourTrans_CurrentFont         *       &0
ColourTrans_CurrentMode         *       &FFFFFFFF
Error_ColourTransBadCalib       *       &A00
Error_ColourTransConvOver       *       &A01
Error_ColourTransBadHSV         *       &A02
Error_ColourTransSwitched       *       &A03
Error_ColourTransBadMiscOp      *       &A04
Error_ColourTransBadFlags       *       &A05
Error_ColourTransBuffOver       *       &A06
Error_ColourTransBadDepth       *       &A07

;Symbols for structure offsets and sizes
                                ^       0
                                #       Bits
ColourTrans_GCOLFlags           *       @

                                ^       0
                                #       Bits
ColourTrans_TableFlags          *       @

                                ^       0
                                #       Bits
ColourTrans_CalibrationFlags    *       @

                                ^       0
                                #       Bits
ColourTrans_PaletteFlags        *       @

                                ^       0
                                #       Bits
ColourTrans_ColourFlags         *       @

                                ^       0
                                #       Bits
ColourTrans_TextColourFlags     *       @

                                ^       0
ColourTrans_GCOLList_gcol       #       OS_GCOL
ColourTrans_GCOLList            *       @

                                ^       0
ColourTrans_CalibrationTable_rcount #       Int
ColourTrans_CalibrationTable_gcount #       Int
ColourTrans_CalibrationTable_bcount #       Int
ColourTrans_CalibrationTable_standard_colour #       OS_Colour
ColourTrans_CalibrationTable    *       @
        
        MACRO
$label                          ColourTrans_CalibrationTable_MEMBERS
$label._rcount                  #       Int
$label._gcount                  #       Int
$label._bcount                  #       Int
        MEND
        
                                ^       0
ColourTrans_CalibrationTableBase ColourTrans_CalibrationTable_MEMBERS
ColourTrans_CalibrationTableBase *       @


;Symbols for SWI's and SWI reason codes
XColourTrans_SelectTable        *       &60740
ColourTrans_SelectTable         *       &40740
   ;Entry
   ;  R0 = source_mode (OS_Mode)
   ;  R1 -> source_palette (OS_Palette)
   ;  R2 = dest_mode (OS_Mode)
   ;  R3 -> dest_palette (OS_Palette)
   ;  R4 = trans_tab (pointer to OSSpriteOp_TransTab)
   ;Exit
   ;  R4 corrupted

XColourTrans_SelectTableForSprite *       &60740
ColourTrans_SelectTableForSprite *       &40740
   ;Entry
   ;  R0 -> source_area (OSSpriteOp_Area)
   ;  R1 = source_id (OSSpriteOp_Id)
   ;  R2 = dest_mode (OS_Mode)
   ;  R3 -> dest_palette (OS_Palette)
   ;  R4 = trans_tab (pointer to OSSpriteOp_TransTab)
   ;  R5 = flags (ColourTrans_TableFlags)
   ;Exit
   ;  R4 corrupted

XColourTrans_SelectGCOLTable    *       &60741
ColourTrans_SelectGCOLTable     *       &40741
   ;Entry
   ;  R0 = source_mode (OS_Mode)
   ;  R1 -> source_palette (OS_Palette)
   ;  R2 = dest_mode (OS_Mode)
   ;  R3 -> dest_palette (OS_Palette)
   ;  R4 = gcol_list (pointer to ColourTrans_GCOLList)

XColourTrans_SelectGCOLTableForSprite *       &60741
ColourTrans_SelectGCOLTableForSprite *       &40741
   ;Entry
   ;  R0 -> source_area (OSSpriteOp_Area)
   ;  R1 = source_id (OSSpriteOp_Id)
   ;  R2 = dest_mode (OS_Mode)
   ;  R3 -> dest_palette (OS_Palette)
   ;  R4 = gcol_list (pointer to ColourTrans_GCOLList)
   ;  R5 = flags (ColourTrans_TableFlags)

XColourTrans_ReturnGCOL         *       &60742
ColourTrans_ReturnGCOL          *       &40742
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;Exit
   ;  R0 = gcol (OS_GCOL)

XColourTrans_SetGCOL            *       &60743
ColourTrans_SetGCOL             *       &40743
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;  R3 = flags (ColourTrans_GCOLFlags)
   ;  R4 = action (OS_Action)
   ;Exit
   ;  R0 = gcol (OS_GCOL)
   ;  R2 = log2_bpp (Int)
   ;  R3 corrupted

XColourTrans_ReturnColourNumber *       &60744
ColourTrans_ReturnColourNumber  *       &40744
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;Exit
   ;  R0 = colour_number (OS_ColourNumber)

XColourTrans_ReturnGCOLForMode  *       &60745
ColourTrans_ReturnGCOLForMode   *       &40745
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;  R1 = mode (OS_Mode)
   ;  R2 -> dest_palette (OS_Palette)
   ;Exit
   ;  R0 = gcol (OS_GCOL)

XColourTrans_ReturnColourNumberForMode *       &60746
ColourTrans_ReturnColourNumberForMode *       &40746
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;  R1 = mode (OS_Mode)
   ;  R2 -> dest_palette (OS_Palette)
   ;Exit
   ;  R0 = colour_number (OS_ColourNumber)

XColourTrans_ReturnOppGCOL      *       &60747
ColourTrans_ReturnOppGCOL       *       &40747
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;Exit
   ;  R0 = gcol (OS_GCOL)

XColourTrans_SetOppGCOL         *       &60748
ColourTrans_SetOppGCOL          *       &40748
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;  R3 = flags (ColourTrans_GCOLFlags)
   ;  R4 = action (OS_Action)
   ;Exit
   ;  R0 = gcol (OS_GCOL)
   ;  R2 = log2_bpp (Int)
   ;  R3 corrupted

XColourTrans_ReturnOppColourNumber *       &60749
ColourTrans_ReturnOppColourNumber *       &40749
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;Exit
   ;  R0 = colour_number (OS_ColourNumber)

XColourTrans_ReturnOppGCOLForMode *       &6074A
ColourTrans_ReturnOppGCOLForMode *       &4074A
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;  R1 = mode (OS_Mode)
   ;  R2 -> dest_palette (OS_Palette)
   ;Exit
   ;  R0 = gcol (OS_GCOL)

XColourTrans_ReturnOppColourNumberForMode *       &6074B
ColourTrans_ReturnOppColourNumberForMode *       &4074B
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;  R1 = mode (OS_Mode)
   ;  R2 -> dest_palette (OS_Palette)
   ;Exit
   ;  R0 = colour_number (OS_ColourNumber)

XColourTrans_GCOLToColourNumber *       &6074C
ColourTrans_GCOLToColourNumber  *       &4074C
   ;Entry
   ;  R0 = gcol (OS_GCOL)
   ;Exit
   ;  R0 = colour_number (OS_ColourNumber)

XColourTrans_ColourNumberToGCOL *       &6074D
ColourTrans_ColourNumberToGCOL  *       &4074D
   ;Entry
   ;  R0 = colour_number (OS_ColourNumber)
   ;Exit
   ;  R0 = gcol (OS_GCOL)

XColourTrans_ReturnFontColours  *       &6074E
ColourTrans_ReturnFontColours   *       &4074E
   ;Entry
   ;  R0 = font (Font_F)
   ;  R1 = bg_hint (OS_Colour)
   ;  R2 = fill (OS_Colour)
   ;  R3 = offset (Int)
   ;Exit
   ;  R1 = bg_hint_out (OS_Colour)
   ;  R2 = fill_out (OS_Colour)
   ;  R3 = offset_out (Int)

XColourTrans_SetFontColours     *       &6074F
ColourTrans_SetFontColours      *       &4074F
   ;Entry
   ;  R0 = font (Font_F)
   ;  R1 = bg_hint (OS_Colour)
   ;  R2 = fill (OS_Colour)
   ;  R3 = offset (Int)
   ;Exit
   ;  R1 = bg_hint_out (OS_Colour)
   ;  R2 = fill_out (OS_Colour)
   ;  R3 = offset_out (Int)

XColourTrans_InvalidateCache    *       &60750
ColourTrans_InvalidateCache     *       &40750

XColourTrans_SetCalibration     *       &60751
ColourTrans_SetCalibration      *       &40751
   ;Entry
   ;  R0 -> calibration_table (ColourTrans_CalibrationTable)

XColourTrans_ReadCalibration    *       &60752
ColourTrans_ReadCalibration     *       &40752
   ;Entry
   ;  R0 = calibration_table (pointer to ColourTrans_CalibrationTable)
   ;Exit
   ;  R1 = size (Int)

XColourTrans_ConvertDeviceColour *       &60753
ColourTrans_ConvertDeviceColour *       &40753
   ;Entry
   ;  R1 = colour (OS_Colour)
   ;  R3 -> calibration_table (ColourTrans_CalibrationTable)
   ;Exit
   ;  R2 = colour_out (OS_Colour)

XColourTrans_ConvertDevicePalette *       &60754
ColourTrans_ConvertDevicePalette *       &40754
   ;Entry
   ;  R0 = colour_count (Int)
   ;  R1 -> list (OS_Colour)
   ;  R2 = buffer (pointer to OS_Colour)
   ;  R3 -> calibration_table (ColourTrans_CalibrationTable)

XColourTrans_ConvertRGBToCIE    *       &60755
ColourTrans_ConvertRGBToCIE     *       &40755
   ;Entry
   ;  R0 = r (Int)
   ;  R1 = g (Int)
   ;  R2 = b (Int)
   ;Exit
   ;  R0 = x (Int)
   ;  R1 = y (Int)
   ;  R2 = z (Int)

XColourTrans_ConvertCIEToRGB    *       &60756
ColourTrans_ConvertCIEToRGB     *       &40756
   ;Entry
   ;  R0 = x (Int)
   ;  R1 = y (Int)
   ;  R2 = z (Int)
   ;Exit
   ;  R0 = r (Int)
   ;  R1 = g (Int)
   ;  R2 = b (Int)

XColourTrans_WriteCalibrationToFile *       &60757
ColourTrans_WriteCalibrationToFile *       &40757
   ;Entry
   ;  R0 = flags (ColourTrans_CalibrationFlags)
   ;  R1 = file (OS_F)
   ;Exit
   ;  R0 corrupted

XColourTrans_WriteCalibrationToFileW *       &60757
ColourTrans_WriteCalibrationToFileW *       &40757
   ;Entry
   ;  R0 = flags (ColourTrans_CalibrationFlags)
   ;  R1 = file (OS_FW)
   ;Exit
   ;  R0 corrupted

XColourTrans_ConvertRGBToHSV    *       &60758
ColourTrans_ConvertRGBToHSV     *       &40758
   ;Entry
   ;  R0 = r (Int)
   ;  R1 = g (Int)
   ;  R2 = b (Int)
   ;Exit
   ;  R0 = h (Int)
   ;  R1 = s (Int)
   ;  R2 = v (Int)

XColourTrans_ConvertHSVToRGB    *       &60759
ColourTrans_ConvertHSVToRGB     *       &40759
   ;Entry
   ;  R0 = h (Int)
   ;  R1 = s (Int)
   ;  R2 = v (Int)
   ;Exit
   ;  R0 = r (Int)
   ;  R1 = g (Int)
   ;  R2 = b (Int)

XColourTrans_ConvertRGBToCMYK   *       &6075A
ColourTrans_ConvertRGBToCMYK    *       &4075A
   ;Entry
   ;  R0 = r (Int)
   ;  R1 = g (Int)
   ;  R2 = b (Int)
   ;Exit
   ;  R0 = c (Int)
   ;  R1 = m (Int)
   ;  R2 = y (Int)
   ;  R3 = k (Int)

XColourTrans_ConvertCMYKToRGB   *       &6075B
ColourTrans_ConvertCMYKToRGB    *       &4075B
   ;Entry
   ;  R0 = c (Int)
   ;  R1 = m (Int)
   ;  R2 = y (Int)
   ;  R3 = k (Int)
   ;Exit
   ;  R0 = r (Int)
   ;  R1 = g (Int)
   ;  R2 = b (Int)

XColourTrans_ReadPalette        *       &6075C
ColourTrans_ReadPalette         *       &4075C
   ;Entry
   ;  R0 -> area (OSSpriteOp_Area)
   ;  R1 = id (OSSpriteOp_Id)
   ;  R2 = palette (pointer to OS_Palette)
   ;  R3 = size (Int)
   ;  R4 = flags (ColourTrans_PaletteFlags)
   ;Exit
   ;  R3 = spare (Int)

XColourTrans_WritePalette       *       &6075D
ColourTrans_WritePalette        *       &4075D
   ;Entry
   ;  R0 -> area (OSSpriteOp_Area)
   ;  R1 = id (OSSpriteOp_Id)
   ;  R2 -> palette (OS_Palette)
   ;  R3 = &0
   ;  R4 = flags (ColourTrans_PaletteFlags)

XColourTrans_SetColour          *       &6075E
ColourTrans_SetColour           *       &4075E
   ;Entry
   ;  R0 = gcol (OS_GCOL)
   ;  R3 = flags (ColourTrans_ColourFlags)
   ;  R4 = action (OS_Action)

XColourTrans_MiscOp             *       &6075F
ColourTrans_MiscOp              *       &4075F

ColourTransMiscOp_SetWeights    *       &0
   ;Entry
   ;  R0 = &0
   ;  R1 = rweight (Int)
   ;  R2 = gweight (Int)
   ;  R3 = bweight (Int)

XColourTrans_WriteLoadingsToFile *       &60760
ColourTrans_WriteLoadingsToFile *       &40760
   ;Entry
   ;  R1 = file (OS_F)

XColourTrans_WriteLoadingsToFileW *       &60760
ColourTrans_WriteLoadingsToFileW *       &40760
   ;Entry
   ;  R1 = file (OS_FW)

XColourTrans_SetTextColour      *       &60761
ColourTrans_SetTextColour       *       &40761
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;  R3 = flags (ColourTrans_TextColourFlags)
   ;Exit
   ;  R0 = gcol (OS_GCOL)

XColourTrans_SetOppTextColour   *       &60762
ColourTrans_SetOppTextColour    *       &40762
   ;Entry
   ;  R0 = colour (OS_Colour)
   ;  R3 = flags (ColourTrans_TextColourFlags)
   ;Exit
   ;  R0 = gcol (OS_GCOL)

XColourTrans_GenerateTable      *       &60763
ColourTrans_GenerateTable       *       &40763
   ;Entry
   ;  R0 = source_mode (OS_Mode)
   ;  R1 -> source_palette (OS_Palette)
   ;  R2 = dest_mode (OS_Mode)
   ;  R3 -> dest_palette (OS_Palette)
   ;  R4 = trans_tab (pointer to OSSpriteOp_TransTab)
   ;  R5 = flags (ColourTrans_TableFlags)
   ;  R6 = workspace (pointer to Void)
   ;  R7 -> transfer_fn (code)
   ;Exit
   ;  R4 = size (Int)

XColourTrans_GenerateTableForSprite *       &60763
ColourTrans_GenerateTableForSprite *       &40763
   ;Entry
   ;  R0 -> source_area (OSSpriteOp_Area)
   ;  R1 = source_id (OSSpriteOp_Id)
   ;  R2 = dest_mode (OS_Mode)
   ;  R3 -> dest_palette (OS_Palette)
   ;  R4 = trans_tab (pointer to OSSpriteOp_TransTab)
   ;  R5 = flags (ColourTrans_TableFlags)
   ;  R6 = workspace (pointer to Void)
   ;  R7 -> transfer_fn (code)
   ;Exit
   ;  R4 = size (Int)

ColourV                         *       &22

Service_CalibrationChanged      *       &5B
   ;Entry
   ;  R1 = &5B

Service_InvalidateCache         *       &82
   ;Entry
   ;  R1 = &82

        ]
        END
